<template>
  <div>
    <!-- 页面基础模板 -->
    <base-header-footer
      :isShowContentTitle="false"
      :isShowBreadCrumb="false"
      :isShowArchived="true"
    >
      <!-- isShowTitle : 布尔值，是否显示当前页面标题组件-->
      <!-- isShowBreadCrumb : 布尔值，是否显示当前页面面包屑导航组件-->
      <!-- isShowArchived : 布尔值，是否显示当前页面归档组件-->
      <template slot="content-item-breadCrumb">
        <BreadCrumb v-if="contentTitle"></BreadCrumb>
      </template>
      <template slot="content-item">
        <!-- 内容插槽 -->
        <article-list>
          <template slot="title"
            ><div class="article-title">
              {{ contentTitle }}
            </div></template
          >
        </article-list>
      </template>
    </base-header-footer>
  </div>
</template>

<script>
import BreadCrumb from "@/components/breadcrumb/BreadCrumb.vue";
import ArticleList from "@/components/articlelist/ArticleList.vue";
import BaseHeaderFooter from "@/components/baseheaderfooter/BaseHeaderFooter.vue";
export default {
  name: "",
  components: {
    BreadCrumb,
    ArticleList,
    BaseHeaderFooter,
  },
  data() {
    return {
      contentTitle: '',
    };
  },
  watch: {
    "$route"(){
      this.getContentTitle();
    },
  },
  created() {
    this.getContentTitle();
  },
  methods: {
    //获取搜索标题
    async getContentTitle() {
      this.contentTitle = "搜索：" + (this.$route.params.keyword || '无');
      let activePathArr = [{ id: 1, path: "/", title: "首页" },{
        id: 2,
        title: this.contentTitle,
      }];
      this.$cookies.set("activePathArr", activePathArr);
    },
  },
};
</script>
<style lang="less" scoped>
</style>